<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>6.270 - JoyOS: hal/uart.h File Reference</title>
	<link href="main.css" media="screen" rel="Stylesheet" type="text/css"/>
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>  
<body>
	<div id="header">
		<div id="headerb">
		<div id="headtext">
			<span class="titletext">AUTONOMOUS ROBOT DESIGN COMPETITION</span>
			6.270
		</div>
		<div class="mainmenu">
			<a href="http://web.mit.edu/6.270/www">Home</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/about/">About</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/sponsors/">Sponsors</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contests/">Past Contests</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contestants/">Contestant Information</a>
		</div>
	</div>
	</div>

<div class="maincontent">
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<h1>hal/uart.h File Reference</h1>UART (USB serial port) functionality. <a href="#_details">More...</a>
<p>
<code>#include &lt;inttypes.h&gt;</code><br>
<code>#include &lt;stdio.h&gt;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="uart_8h.html#e105f85e3fc8c80a573b9efc762d1779">uart_send</a> (char ch)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="uart_8h.html#ebc828d33e689791ae7adcce3995f727">uart_put</a> (char, FILE *)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="uart_8h.html#3f1241d830139b26251498fe4e209088">uart_print</a> (const char *string)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="uart_8h.html#d2ac237dc835ce470a94098dd9816a8d">uart_printf</a> (const char *fmt,...)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="uart_8h.html#1d5e43da42875080c736c908189d7417">uart_init</a> (uint16_t baudRate)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The Happyboard has a FT232RL USB serial bridge chip on board, which makes it appear as a serial port on most OS's (Windows/Mac/Linux). Users can print information to the UART and monitor it on a computer using a terminal emulator program such as hyperterminal or minicom.<p>
The Happyboard configures the UART for 19200 baud, 8N1. <hr><h2>Function Documentation</h2>
<a class="anchor" name="1d5e43da42875080c736c908189d7417"></a><!-- doxytag: member="uart.h::uart_init" ref="1d5e43da42875080c736c908189d7417" args="(uint16_t baudRate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_init           </td>
          <td>(</td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>baudRate</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initialize the UART driver. 
</div>
</div><p>
<a class="anchor" name="3f1241d830139b26251498fe4e209088"></a><!-- doxytag: member="uart.h::uart_print" ref="3f1241d830139b26251498fe4e209088" args="(const char *string)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_print           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>string</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Print an unformated string directly to UART. 
</div>
</div><p>
<a class="anchor" name="d2ac237dc835ce470a94098dd9816a8d"></a><!-- doxytag: member="uart.h::uart_printf" ref="d2ac237dc835ce470a94098dd9816a8d" args="(const char *fmt,...)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int uart_printf           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&nbsp;</td>
          <td class="paramname"> <em>...</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Print a formated string to UART. 
</div>
</div><p>
<a class="anchor" name="ebc828d33e689791ae7adcce3995f727"></a><!-- doxytag: member="uart.h::uart_put" ref="ebc828d33e689791ae7adcce3995f727" args="(char, FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int uart_put           </td>
          <td>(</td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
putc function used by printf. 
</div>
</div><p>
<a class="anchor" name="e105f85e3fc8c80a573b9efc762d1779"></a><!-- doxytag: member="uart.h::uart_send" ref="e105f85e3fc8c80a573b9efc762d1779" args="(char ch)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int uart_send           </td>
          <td>(</td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>ch</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Send a character over UART. 
</div>
</div><p>
</div>
<div class="maincontent">
	<div class="footer centre">
		<hr>
		Generated on Tue Jan 29 23:17:08 2008 by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> 1.5.1<br/>
		6.270 Staff, 2008 | 
		<a href="mailto:6.270-organizers@mit.edu">Contact Us</a> | 
		<a href="http://web.mit.edu">MIT</a>
	</div>
</div>
</body>
</html>
